package com.mp.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.FieldFill;

import lombok.Data;

@Data   //lombok注解，简化实体类，不写getter/setter/tostring等
public class Employee extends Model<Employee>{  //使用activerecord继承Model，重写pkVal
	private Integer id;
	//使用@TableField注解标记填充字段
	@TableField(fill = FieldFill.INSERT_UPDATE) //插入和更新是填充
	private String name;
	private String sex;
	private Integer age;
	private Integer dep_id;
	private String type;
	private Integer year;
	@Override
	protected Serializable pkVal() {
		return id;  //重写pkVal(),返回主键
	}
}	
